home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / dosutils / tsbat50.zip / EXE2ZIP.BAT < prev    next >
DOS Batch File  |  1992-08-30  |  2KB  |  100 lines

  1. @echo off
  2.  
  3. echo.
  4. echo ┌─────────────────────────────────────────────────────────────────────┐
  5. echo │ Convert + datestamp self-extracting file to .zip file, with comment │
  6. echo │ By Prof. Timo Salmi, ts@chyde.uwasa.fi, Sun 30-Aug-1992             │
  7. echo └─────────────────────────────────────────────────────────────────────┘
  8. echo.
  9.  
  10. rem You need help :-)
  11. if "%1"=="" goto _help
  12.  
  13. rem Check that wilrcards have not been used
  14. for %%f in (%1) do if "%1"=="%%f" goto :_testext
  15. echo No wildcards allowed in the file name %1
  16. goto _out
  17.  
  18. rem Check that no extension was used
  19. :_testext
  20. set _exten=%1
  21. :_nextchar
  22. set _prev=%_exten%
  23. for %%f in (/%_exten%) do set _exten=%%f
  24. if ".%_exten%"=="%_prev%" goto _extfound
  25. if not "%_exten%"=="%_prev%" goto _nextchar
  26. goto _noext
  27.  
  28. :_extfound
  29. echo No extension allowed in the file name %1
  30. goto _out
  31.  
  32. :_noext
  33. set _exten=
  34. rem Check for the necessary programs and status
  35. rem You'' have to customize these
  36. if not exist %1.exe goto _notfound
  37. if not exist e:\arczip\comment.txt goto _nocomment
  38. if not exist c:\tools\scan.exe goto _noscan
  39. if not exist c:\tools\pkzip.exe goto _nopkzip
  40. if not exist r:\nul goto _no_r
  41. if exist r:\tmp$$$\*.* goto _notempty
  42.  
  43. rem Convert (I have r: as ramdisk, customize as applicable)
  44. r:
  45. if not exist r:\tmp$$$\nul mkdir r:\tmp$$$
  46. cd \tmp$$$
  47. r:\%1
  48. if not exist r:\tmp$$$\*.* goto _notsfx
  49. c:\tools\scan /m /nomem r:\tmp$$$
  50. if errorlevel==1 goto _virus
  51. pkzip -mu -o -z r:\%1 *.* < e:\arczip\comment.txt
  52. cd \
  53. rmdir r:\tmp$$$
  54. goto _out
  55.  
  56. :_notfound
  57. echo File %1.exe not found
  58. goto _out
  59.  
  60. :_nocomment
  61. echo File e:\arczip\comment.txt not found
  62. echo You'll have to customize the batch or omit this feature
  63. goto _out
  64.  
  65. :_noscan
  66. echo File c:\tools\scan.exe not found
  67. echo You'll have to adjust for your own configuration
  68. goto _out
  69.  
  70. :_nopkzip
  71. echo File c:\tools\pkzip.exe not found
  72. echo You'll have to adjust for your own configuration
  73. goto _out
  74.  
  75. :_no_r
  76. echo No R: drive
  77. echo Customize the batch or create one with SUBST
  78. goto _out
  79.  
  80. :_notempty
  81. echo Directory r:\tmp$$$ not empty
  82. goto _out
  83.  
  84. :_notsfx
  85. echo File %1.exe is not self-extracting
  86. cd \
  87. rmdir r:\tmp$$$
  88. goto _out
  89.  
  90. :_virus
  91. echo Virus warning
  92. cd \
  93. goto _out
  94.  
  95. :_help
  96. echo Usage: EXE2ZIP FileName  (No path, no extension)
  97.  
  98. :_out
  99. echo on
  100.